import { ColumnGroupType, ColumnType } from "antd/es/table"

export const bankRecordsetupColumns = (
	newFormat: (p: { id: string } | string) => string,
	_getFromDic: (arg: string, strictlyLabel?: boolean) => any
): Record<string, ColumnGroupType<any> | ColumnType<any>> => ({
	bankRecord_userName: {
		key: "userName",
		dataIndex: "userName",
		title: newFormat("common.member_number"),
		align: "center",
		width: 120,
		render: (_text: any, record: any) => <div>{record.userName ?? "-"}</div>
	},
	bankRecord_accountType: {
		key: "accountType",
		dataIndex: "accountType",
		title: newFormat("common.account_type"),
		align: "center",
		width: 120,
		render: (_text: any, record: any) => <div>{record.accountType ?? "-"}</div>
	},
	bankRecord_parentProxyName: {
		key: "parentProxyName",
		dataIndex: "parentProxyName",
		title: newFormat("common.top_agent"),
		align: "center",
		width: 120,
		render: (_text: any, record: any) => <div>{record.parentProxyName ?? "-"}</div>
	},
	bankRecord_merchantId: {
		key: "merchantId",
		dataIndex: "merchantId",
		title: newFormat("common.belong_merchant"),
		align: "center",
		width: 120,
		render: _getFromDic("merchantList")
	},
	bankRecord_cardNumber: {
		key: "cardNumber",
		dataIndex: "cardNumber",
		title: newFormat("common.components.card_number"),
		align: "center",
		width: 120
	},
	bankRecord_bankAddress: {
		key: "bankAddress",
		dataIndex: "bankAddress",
		title: (
			<div>
				<div>{newFormat("common.components.card_name")}</div>
				<div>{newFormat("member.vitual.bank_branch")}</div>
			</div>
		),
		align: "center",
		width: 120,
		render: (_text: any, record: any) => (
			<div>
				<div>{record.bankName ?? "-"}</div>
				<div>{record.bankAddress ?? "-"}</div>
			</div>
		)
	},
	bankRecord_windControlName: {
		key: "windControlName",
		dataIndex: "windControlName",
		title: newFormat("label.risk_level"),
		align: "center",
		width: 120,
		render: (_text: any, record: any) => <div>{record.windControlName ?? "-"}</div>
	},
	bankRecord_cnName: {
		key: "cnName",
		dataIndex: "cnName",
		title: newFormat("member.vitual.card_holder"),
		align: "center",
		width: 120,
		render: (_text: any, record: any) => <div>{record.cnName ?? "-"}</div>
	},
	bankRecord_operateType: {
		key: "operateType",
		dataIndex: "operateType",
		title: newFormat("common.operation_type"),
		align: "center",
		width: 120,
		render: _getFromDic("operateTypeArr", false)
	},
	bankRecord_remark: {
		key: "remark",
		dataIndex: "remark",
		title: newFormat("common.components.remark"),
		align: "center",
		width: 120,
		render: (_text: any, record: any) => <div>{record.remark ?? "-"}</div>
	},
	bankRecord_updateBy: {
		key: "operator",
		dataIndex: "operator",
		title: newFormat("common.updateBy"),
		align: "center",
		width: 120
	},
	bankRecord_updateAt: {
		key: "createDt",
		dataIndex: "createDt",
		title: newFormat("common.updateAt"),
		align: "center",
		width: 120
	}
})
